package com.wifeacountbook;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
/**
 * <p>
 * the app setting all in here.
 * </p>
 * @author yqg1817
 *
 */
public class Setting extends PreferenceActivity  {
	public static final String LOCAL_SAVECHECK_KEY = "local_password_pref";
	private EditTextPreference dialogPref = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.layout.setting);
		if(dialogPref == null)
			dialogPref = (EditTextPreference) getPreferenceScreen().findPreference(LOCAL_SAVECHECK_KEY);
		SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
        String password = defaultSharedPreferences.getString(Setting.LOCAL_SAVECHECK_KEY, "");
		//dialogPref.setOnPreferenceChangeListener(this);
		dialogPref.setDefaultValue(password);
	}

	
	
}
